#pragma once
#include "EquippableItem.h"

class Tool : public EquippableItem {
protected:
	int m_power;
	int m_defaultPower;
	int m_speed;
	int m_defaultSpeed;
	ToolPrefix m_prefix;
	ToolSuffix m_suffix;
	bool m_highQuality;
	bool isEnchanted() const;
public:
	Tool(ToolType type, ToolPrefix prefix = TP_NONE, ToolSuffix suffix = TS_OF_NONE, bool highQuality = false);
	Tool(std::ifstream& file);
	~Tool();
	void render(float x, float y);
	void logDetails(TextLog& log) const;
	ToolPrefix getPrefix() const;
	ToolSuffix getSuffix() const;
	int getPower() const;
	int getSpeed() const;
	bool isHighQuality() const;
	std::string getItemName(int mod = 0) const;
	void save(std::ofstream& file) const;
};

inline ToolPrefix Tool::getPrefix() const {return m_prefix;}
inline ToolSuffix Tool::getSuffix() const {return m_suffix;}
inline int Tool::getPower() const {return m_power;}
inline int Tool::getSpeed() const {return m_speed;}
inline bool Tool::isHighQuality() const {return m_highQuality;}
